package day19;

import java.util.Scanner;

//汽水瓶
public class oj1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        while(sc.hasNext()) {
            int n = sc.nextInt();
            if(n > 1) {
                int num = getNum(n);
                System.out.println(num);
            }
        }
    }
    public static int getNum(int num) {

        int sum = 0;
        while(num > 1) {

            sum += num / 3;
            num = num % 3 + num / 3;
            if(num == 2) {
                sum++;
                break;
            }
        }
        return sum;
    }
}
